/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import controller.dialog.DialogOferta;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import model.TAGS;
import rmi.RMIServer;

/**
 * FXML Controller class
 *
 * @author Adriano
 */
public class OfertasController implements Initializable {

    @FXML
    private Label message;

    @Override
    public void initialize(URL url, ResourceBundle rb) {
    }

    public void sim(ActionEvent event) {
        try {
            RMIServer.getInstacia().getJogadas().comprarCampo(TAGS.NAME, true);
        } catch (RemoteException ex) {
            ex.printStackTrace();
        }
        DialogOferta.getIntancia().close();
    }

    public void nao(ActionEvent event) {

        try {
            RMIServer.getInstacia().getJogadas().comprarCampo(TAGS.NAME, false);
        } catch (RemoteException ex) {
            ex.printStackTrace();
        }
        DialogOferta.getIntancia().close();
    }
}
